package com.example.taobaounion3.utils;

import com.example.taobaounion3.presenter.ICategoryPagerPresenter;
import com.example.taobaounion3.presenter.IHomePresenter;
import com.example.taobaounion3.presenter.ISelectedPagePresenter;
import com.example.taobaounion3.presenter.ITicketPresenter;
import com.example.taobaounion3.presenter.impl.CategoryPagePresenterlmpl;
import com.example.taobaounion3.presenter.impl.HomePresenterlmpl;
import com.example.taobaounion3.presenter.impl.SelectedPagePresenterlmpl;
import com.example.taobaounion3.presenter.impl.TicketPresenterlmpl;
//管理多個presenter，实现单例
public class PresenterManager {
    private static final PresenterManager ourInstance=new PresenterManager();
    //暴露接口，隐藏具体的实现
    private final ICategoryPagerPresenter mCategoryPagePresenter ;
    private final IHomePresenter mHomePresenter;
    private final ITicketPresenter mTicketPresenter;

    private final ISelectedPagePresenter mSelectedPagePresenter;

    public static PresenterManager getInstance(){
        return ourInstance;
    }

    public ICategoryPagerPresenter getmCategoryPagePresenter() {
        return mCategoryPagePresenter;
    }

    public IHomePresenter getmHomePresenter() {
        return mHomePresenter;
    }

    public ITicketPresenter getmTicketPresenter() {
        return mTicketPresenter;
    }

    public ISelectedPagePresenter getmSelectedPagePresenter() {
        return mSelectedPagePresenter;
    }

    private PresenterManager(){
        mCategoryPagePresenter=new CategoryPagePresenterlmpl();
        mHomePresenter=new HomePresenterlmpl();
        mTicketPresenter =new TicketPresenterlmpl();
        mSelectedPagePresenter=new SelectedPagePresenterlmpl();
    }
}
